﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EZCRS.HCMS.Entity;
using EZCRS.HCMS.Bll.baseinfo;
using HCMS.Utility;
using System.Data;
using System.Reflection;

namespace EZCRS.HCMS
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            List<HCRS_AIR> lt = new BllHCRS_AIR().getall("year=2009 and level='P' and property_id=999");
            DataSetUtility dsu = new DataSetUtility();
            HCRS_AIR air = lt[0];
            MemberInfo[] mymember = air.GetType().GetMember("December_AI");
            Response.Write(mymember.Length);
            if (mymember.Length > 0)
            {
                if ((byte[])((System.Reflection.PropertyInfo)mymember[0]).GetValue(air, null) != null)
                {
                    DataSet ds = dsu.RetrieveDataSet((byte[])((System.Reflection.PropertyInfo)mymember[0]).GetValue(air, null));
                    if (ds.Tables.Count>0)
                    {
                        GridView1.DataSource = ds;
                        GridView1.DataBind();
                    }
                }
            }
        }
    }
}
